Data streams, such as those formatted according to the second standard of the Motion Pictures Expert Group (MPEG2) and similar media containers, may contain temporal discontinuities in time stamps. Discontinuities may be produced by a Digital Video Disc (DVD) encoder or hardware encoder. Producing a discontinuity may have the effect of “zeroing” a time stamp in the data stream. This may occur when, for example, a time field has a limited bit-length. Zeroing may also be needed with mandatory time-stamp resetting for each new scene of a movie on a DVD. Accurate detection of discontinuities may improve reliability and performance of media playback operations such as duration estimation and time-seeking.
Discontinuity detection may include finding the byte position of sequential time-stamps separated by a significant difference. For example, an initial timestamp of five seconds may be followed by a subsequent time stamp of zero seconds. To find the discontinuity, equidistant check points may be distributed along the data stream. Temporal discontinuities are then searched for at each check point. This traditional method of discontinuity detection, however, may fail to recognize closely spaced discontinuities such as those located between the equidistant check points. Furthermore, in instances where there are relatively few discontinuities, the traditional method may fail to efficiently adapt to this condition by increasing the distance between checkpoints. This may result in a slower performance associated with the burden of continuing to distribute checkpoints at, for example, predetermined intervals despite the presence of relatively few discontinuities